#fix mysql index error 145
def fix_mysql_index():
    import os
    os.chdir(r"c:\ProgramData\MySQL\MySQL Server 5.5\data\cardpool")
    os.system(r'"d:\Program Files (x86)\MySQL\MySQL Server 5.5\bin\myisamchk.exe" -r tb_prepare_attendance')
    os.system(r'del /f /q "D:\Program Files (x86)\Attend\AttendManage\CardZip\*"')

try:
    fix_mysql_index()
except Exception as e:
    print "fix mysql error:", str(e)
